﻿@using WindMill.Models.Cadastro
@model WindMill.Models.Estoque.Classe

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


@section Scripts{
    
    @Scripts.Render("~/Content/plugins/quicksearch/jquery.quicksearch.min.js")
    @Scripts.Render("~/Content/plugins/form-typeahead/typeahead.min.js")
    @Scripts.Render("~/Content/plugins/form-select2/select2.min.js")
    @Scripts.Render("~/Content/plugins/form-autosize/jquery.autosize-min.js")
    @Scripts.Render("~/Content/plugins/jqueryui-timepicker/jquery.ui.timepicker.min.js")
    @Scripts.Render("~/Content/plugins/form-daterangepicker/daterangepicker.min.js")    
	@Scripts.Render("~/Content/demo/demo-formcomponents.js")
    @*@Scripts.Render("~/Content/plugins/form-multiselect/js/jquery.multi-select.min.js")*@
    @Scripts.Render("~/Scripts/lookup-field.js")    
}

@section styles{
    @Styles.Render("~/Content/plugins/form-select2/select2.css") 
    @Styles.Render("~/Content/plugins/form-multiselect/css/multi-select.css") 
    @Styles.Render("~/Content/plugins/jqueryui-timepicker/jquery.ui.timepicker.css") 
    @Styles.Render("~/Content/plugins/form-daterangepicker/daterangepicker-bs3.css") 
    @Styles.Render("~/Content/js/jqueryui.css") 
    @Styles.Render("~/Content/plugins/codeprettifier/prettify.css") 
    @Styles.Render("~/Content/plugins/form-toggle/toggles.css") 
}


<div class="container">


<div class="row">
<div class="col-xs-12">
<div class="panel panel-midnightblue">
<div class="panel-heading"><h4>Classe</h4></div>
<div class="panel-body">
<p>Preencha os todos os campos necessários para fazer o cadastro.</p>
@using (Ajax.BeginForm("CreateAjax","Classe", new AjaxOptions(){Confirm = "Deseja mesmo salvar?",HttpMethod = "POST",OnComplete = "formComplete",OnSuccess = "formSuccess"},new{ @class="form-horizontal row-border",@style="padding-left:10px",@id="validate-form"}))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)    
    <div class="form-group">                        
        <div class="row">
            <div class="col-xs-2">
                @Html.LabelFor(model => model.CodClasse, new { @class = "control-label" })
                @Html.EditorFor(model => model.CodClasse,new{ @isReadOnly = true})
                @Html.ValidationMessageFor(model => model.CodClasse)
            </div>                
            <div class="col-xs-2">
                @Html.LabelFor(model => model.NumClasse, new { @class = "control-label" })
                @Html.EditorFor(model => model.NumClasse, new {@required=true})
                @Html.ValidationMessageFor(model => model.NumClasse)
            </div>                
            <div class="col-xs-2">
                @Html.LabelFor(model => model.NumSubclasse, new { @class = "control-label" })
                @Html.EditorFor(model => model.NumSubclasse)
                @Html.ValidationMessageFor(model => model.NumSubclasse)
            </div>
               <div class="col-xs-4">
                @Html.LabelFor(model => model.IndTipo, new { @class = "control-label" })
                @Html.DropDownList("IndTipo",(SelectList)ViewBag.IndTipos,"Selecione uma parada",new{@class="populate select2",@style="width:100%"})
                @Html.ValidationMessageFor(model => model.IndTipo)
            </div>
        </div>
                          
        <div class="row">
            <div class="col-xs-10">
                @Html.LabelFor(model => model.DescClasse, new { @class = "control-label" })
                @Html.EditorFor(model => model.DescClasse)
                @Html.ValidationMessageFor(model => model.DescClasse)
            </div>           
        </div>
        <div class="row">
            <div class="col-xs-2">
                @Html.LabelFor(model => model.PercComissao1, new { @class = "control-label" })
                @Html.EditorFor(model => model.PercComissao1)
                @Html.ValidationMessageFor(model => model.PercComissao1)
            </div>                
            <div class="col-xs-2">
                @Html.LabelFor(model => model.PercComissao2, new { @class = "control-label" })
                @Html.EditorFor(model => model.PercComissao2)
                @Html.ValidationMessageFor(model => model.PercComissao2)
            </div>                
            <div class="col-xs-2">
                @Html.LabelFor(model => model.ValCusto, new { @class = "control-label" })
                @Html.EditorFor(model => model.ValCusto)
                @Html.ValidationMessageFor(model => model.ValCusto)
            </div>
        </div>
       
        <div class="row">
            @Html.LookupFieldFor(model => model.CodRamo)
        </div>
        <div class="row">
            @Html.LookupFieldFor(model => model.CodMensagem,@Url.Action("Create"),@Url.Action("Index"))        
        </div>
        <div class="row">
            @Html.LookupFieldFor(model => model.CodContaContabil)
        </div>
    </div>


}
</div>
<div class="panel-footer">
<div class="row">
<div class="col-sm-6">
<div class="btn-toolbar">
    <button class="btn-primary btn" onclick="javascript:jQuery('#validate-form').submit();">Salvar</button>    
    <button class="btn-default btn" onClick="self.location='@Url.Action("Index")';">Cancelar</button>    
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</div> <!-- container --> 
